﻿<ResourceDictionary
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:ProxyToggle="clr-namespace:ProxyToggle" 
     xmlns:Borders="clr-namespace:ProxyToggle.Borders" 
     xmlns:Utils="clr-namespace:ProxyToggle.Utils"
     xmlns:Controls="clr-namespace:ProxyToggle.Controls" 
     xmlns:DemoUtils="clr-namespace:ProxyToggle.Utils">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/ProxyToggle;component/Themes/Generic.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <DemoUtils:CornerRadiusValueConverter x:Key="CornerRadiusValueConverter"/>
    <DemoUtils:ScalarValueConverter x:Key="ScalarConverter"/>

    <LinearGradientBrush x:Key="iPhoneThumbBrush"  EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFD8D7D8"/>
        <GradientStop Color="#FFFDFCFD" Offset="1"/>
    </LinearGradientBrush>

    <ControlTemplate x:Key="EngravedContentTemplate" TargetType="ContentControl">
        <Controls:DropShadowTextBlock 
                        DropShadowColor="#FFF7F7F7" 
                        DropShadowOpacity="0.3" 
                        DropShadowDistance="1" 
                        DropShadowAngle="90" 
                        Cursor="{TemplateBinding Cursor}" 
                        Text="{TemplateBinding Content}" 
                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                        Margin="{TemplateBinding Padding}" 
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                        Foreground="{TemplateBinding Foreground}" 
                        FontFamily="{TemplateBinding FontFamily}" 
                        FontSize="{TemplateBinding FontSize}" 
                        FontWeight="{TemplateBinding FontWeight}" 
                        FontStyle="{TemplateBinding FontStyle}" 
                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Focusable="False" IsTabStop="False"/>
    </ControlTemplate>

    <ControlTemplate x:Key="GroovedThumbTemplate" TargetType="Thumb">
        <Grid Background="Transparent">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.05" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.25" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.05" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualElement"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Unfocused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="CheckStates">
                    <VisualState x:Name="Unchecked"/>
                    <VisualState x:Name="Checked"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Borders:OuterGlowBorder OuterGlowSize="4" OuterGlowOpacity="0.15" BorderThickness="0" OuterGlowColor="Black" Background="Transparent" CornerRadius="4" ShadowCornerRadius="8" IsTabStop="False" >
                <Grid>
                    <Borders:ClippingBorder x:Name="Background" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4" IsTabStop="False" Background="White">
                        <Border BorderBrush="#FFEBEBEB" CornerRadius="3" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" Padding="6">
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                <Rectangle Fill="#7F969696" Width="1" StrokeThickness="0"/>
                                <Rectangle Fill="#7FF8F8F8" Width="1" StrokeThickness="0" Margin="0,0,1,0" />
                                <Rectangle Fill="#7F969696" Width="1" StrokeThickness="0" />
                                <Rectangle Fill="#7FF8F8F8" Width="1" StrokeThickness="0" Margin="0,0,1,0"/>
                                <Rectangle Fill="#7F969696" Width="1" StrokeThickness="0" />
                                <Rectangle Fill="#7FF8F8F8" Width="1" StrokeThickness="0" />
                            </StackPanel>
                        </Border>
                    </Borders:ClippingBorder>
                    <Borders:ClippingBorder x:Name="BackgroundAnimation" Background="Black" Opacity="0" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="Black" CornerRadius="4" IsTabStop="False"/>
                    <Rectangle x:Name="DisabledVisualElement" Fill="White" IsHitTestVisible="false" Opacity="0" RadiusY="4" RadiusX="4"/>
                    <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="4" RadiusX="4" StrokeThickness="1"/>
                </Grid>
            </Borders:OuterGlowBorder>
        </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="iOS5ThumbTemplate" TargetType="Thumb">
        <Grid Background="Transparent">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.05" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.25" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.05" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualElement"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Unfocused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="CheckStates">
                    <VisualState x:Name="Unchecked"/>
                    <VisualState x:Name="Checked"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Borders:OuterGlowBorder OuterGlowSize="1" BorderThickness="0" OuterGlowColor="Black" Background="Transparent" CornerRadius="10" ShadowCornerRadius="12" IsTabStop="False" OuterGlowOpacity="0.05" >
                <Grid>
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="11" Background="{TemplateBinding Background}">
                        <Borders:ClippingBorder x:Name="Background" CornerRadius="12" IsTabStop="False" Background="{TemplateBinding Background}" BorderBrush="#FFEBEBEB" BorderThickness="1"/>
                    </Border>
                    <Borders:ClippingBorder x:Name="BackgroundAnimation" Background="Black" Opacity="0" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="Black" CornerRadius="11" IsTabStop="False"/>
                    <Rectangle x:Name="DisabledVisualElement" Fill="White" IsHitTestVisible="false" Opacity="0" RadiusY="11" RadiusX="11"/>
                    <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="9" RadiusX="9" StrokeThickness="1"/>
                </Grid>
            </Borders:OuterGlowBorder>
        </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="BrushedThumbTemplate" TargetType="Thumb">
        <Grid Background="Transparent">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.05" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.25" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.05" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualElement"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Unfocused"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Image Source="/ProxyToggle;component/Images/Knob.png"/>
            <Borders:ClippingBorder x:Name="BackgroundAnimation" Background="Black" Opacity="0" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="Black" CornerRadius="14"/>
            <Rectangle x:Name="DisabledVisualElement" IsHitTestVisible="false" Opacity="0" RadiusY="14" RadiusX="14"/>
            <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Opacity="0" RadiusY="14" RadiusX="14"/>
        </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="SimpleThumbTemplate" TargetType="Thumb">
        <Grid Background="Transparent">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.05" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.25" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.05" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualElement"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Unfocused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="CheckStates">
                    <VisualState x:Name="Unchecked"/>
                    <VisualState x:Name="Checked"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Borders:OuterGlowBorder OuterGlowSize="4" OuterGlowOpacity="0.15" BorderThickness="0" OuterGlowColor="Black" Background="Transparent" CornerRadius="4" ShadowCornerRadius="8" IsTabStop="False" >
                <Grid>
                    <Borders:ClippingBorder x:Name="Background" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4" IsTabStop="False" Background="{TemplateBinding Background}"/>
                    <Borders:ClippingBorder x:Name="BackgroundAnimation" Background="Black" Opacity="0" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="Black" CornerRadius="4" IsTabStop="False"/>
                    <Rectangle x:Name="DisabledVisualElement" Fill="White" IsHitTestVisible="false" Opacity="0" RadiusY="4" RadiusX="4"/>
                    <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="4" RadiusX="4" StrokeThickness="1"/>
                </Grid>
            </Borders:OuterGlowBorder>
        </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="ThumbWithDoubleArrowTemplate" TargetType="Thumb">
        <Grid Background="Transparent">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.05" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.25" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.05" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualElement"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Unfocused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="CheckStates">
                    <VisualState x:Name="Unchecked"/>
                    <VisualState x:Name="Checked"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Borders:OuterGlowBorder OuterGlowSize="4" OuterGlowOpacity="0.15" BorderThickness="0" OuterGlowColor="Black" Background="Transparent" CornerRadius="2" ShadowCornerRadius="8" IsTabStop="False" >
                <Grid>
                    <Borders:ClippingBorder x:Name="Background" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2" IsTabStop="False" Background="{TemplateBinding Background}">
                        <StackPanel Orientation="Horizontal" Height="6" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Path Data="M0,0 L0,6 L-5,3" Fill="{TemplateBinding Foreground}" Stretch="Fill" StrokeThickness="0" Margin="0,0,2,0"/>
                            <Path Data="M0,0 L0,6 L5,3" Fill="{TemplateBinding Foreground}" Stretch="Fill" StrokeThickness="0" Margin="2,0,0,0"/>
                        </StackPanel>
                    </Borders:ClippingBorder>
                    <Borders:ClippingBorder x:Name="BackgroundAnimation" Background="Black" Opacity="0" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="Black" CornerRadius="2" IsTabStop="False"/>
                    <Rectangle x:Name="DisabledVisualElement" Fill="White" IsHitTestVisible="false" Opacity="0" RadiusY="2" RadiusX="2"/>
                    <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="2" RadiusX="2" StrokeThickness="1"/>
                </Grid>
            </Borders:OuterGlowBorder>
        </Grid>
    </ControlTemplate>
    <ControlTemplate x:Key="RestartThumbTemplate" TargetType="Thumb">
        <Grid Background="Transparent">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.05" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.25" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.05" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualElement"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Unfocused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="CheckStates">
                    <VisualState x:Name="Unchecked"/>
                    <VisualState x:Name="Checked">
                        <Storyboard RepeatBehavior="Forever">
                            <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="LoadingGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)">
                                <LinearDoubleKeyFrame KeyTime="0" Value="0"/>
                                <LinearDoubleKeyFrame KeyTime="00:00:01" Value="359"/>
                            </DoubleAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="LoadingGrid">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="path">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Borders:OuterGlowBorder OuterGlowSize="4" OuterGlowOpacity="0.15" BorderThickness="0" OuterGlowColor="Black" Background="Transparent" CornerRadius="4" ShadowCornerRadius="8" IsTabStop="False" >
                <Grid>
                    <Borders:ClippingBorder x:Name="Background" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4" IsTabStop="False" Background="White">
                        <Border BorderBrush="#FFEBEBEB" CornerRadius="3" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
                            <Grid>
                                 <Path x:Name="path" Data="M3.6,2.6 L10,2.6 L10,6.6 L3.6,6.6 z M10,0 L15.5,4.6 L10,9.4 z" Fill="#AA767676" Stretch="Fill" StrokeThickness="0" Margin="7,5" />
                                <StackPanel x:Name="LoadingGrid" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed">
                                    <StackPanel.RenderTransform>
                                        <RotateTransform/>
                                    </StackPanel.RenderTransform>
                                    <Path Data="F1 M 10,3 C 6,3 3,6 3,10 L 0,10 C 0,4.5 4.5,0 10,0 C 15.5,0 20,4.5 20,10 L 17,10 C 17,6 14,3 10,3 Z" Height="9" Width="18" HorizontalAlignment="Center" Stretch="Fill" >
                                        <Path.Fill>
                                            <LinearGradientBrush MappingMode="Absolute" StartPoint="400,240.414" EndPoint="420,240.414">
                                                <LinearGradientBrush.Transform>
                                                    <MatrixTransform Matrix="-1,0,0,-1,420,245"/>
                                                </LinearGradientBrush.Transform>
                                                <GradientStop Offset="0.25" Color="#FF7F7F7F"/>
                                                <GradientStop Offset="1" Color="#FF3F3F3F"/>
                                            </LinearGradientBrush>
                                        </Path.Fill>
                                    </Path>
                                    <Path Data="F1 M17,0 C17,0 17,0 17,0 C17,4 14,7 10,7 C6,7 3,4 3,0 C3,0 3,0 3,0 L0,0 C0,0 0,0 0,0 C0,5 5,10 10,10 C15.5,10 20,5 20,0 C20,0 20,0 20,0 L17,0 z" Height="9" Width="18" HorizontalAlignment="Center" Stretch="Fill">
                                        <Path.Fill>
                                            <LinearGradientBrush MappingMode="Absolute" StartPoint="489.5,230.5" EndPoint="509.5,230.5">
                                                <LinearGradientBrush.Transform>
                                                    <MatrixTransform Matrix="1,0,-0,-1,-489.5,245"/>
                                                </LinearGradientBrush.Transform>
                                                <GradientStop Offset="0" Color="White"/>
                                                <GradientStop Offset="0.75" Color="#FF7F7F7F"/>
                                            </LinearGradientBrush>
                                        </Path.Fill>
                                    </Path>
                                </StackPanel>
                            </Grid>
                        </Border>
                    </Borders:ClippingBorder>
                    <Borders:ClippingBorder x:Name="BackgroundAnimation" Background="Black" Opacity="0" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="Black" CornerRadius="4" IsTabStop="False"/>
                    <Rectangle x:Name="DisabledVisualElement" Fill="White" IsHitTestVisible="false" Opacity="0" RadiusY="4" RadiusX="4"/>
                    <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="4" RadiusX="4" StrokeThickness="1"/>
                </Grid>
            </Borders:OuterGlowBorder>
        </Grid>
    </ControlTemplate>

    <Style x:Key="LightBulbToggleSwitchStyle" TargetType="ProxyToggle:HorizontalToggleSwitch">
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Width" Value="130"/>
        <Setter Property="Height" Value="Auto"/>
        <Setter Property="ThumbSize" Value="22"/>
        <Setter Property="ContentTemplate" Value="{StaticResource PresenterContentTemplate}" />
        <Setter Property="ThumbTemplate" Value="{StaticResource BrushedThumbTemplate}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ProxyToggle:HorizontalToggleSwitch">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="DisabledOverlay">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.10" To="Unchecked"/>
                                    <VisualTransition GeneratedDuration="0:0:0.10" To="Checked"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SwitchUncheckedLabel" />
                                        <DoubleAnimation Duration="0" To="0.99" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SwitchCheckedLabel" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SwitchCheckedLabel" />
                                        <DoubleAnimation Duration="0" To="0.99" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SwitchUncheckedLabel" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DraggingChecked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SwitchUncheckedLabel" />
                                        <DoubleAnimation Duration="0" To="0.99" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SwitchCheckedLabel" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DraggingUnchecked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SwitchCheckedLabel" />
                                        <DoubleAnimation Duration="0" To="0.99" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SwitchUncheckedLabel" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused"/>
                                <VisualState x:Name="Focused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentControl x:Name="SwitchUncheckedLabel" 
                            Content="{TemplateBinding UncheckedContent}" 
                            HorizontalContentAlignment="Center" 
                            VerticalContentAlignment="Center" 
                            Template="{TemplateBinding ContentTemplate}" 
                            Foreground="{TemplateBinding UncheckedForeground}" 
                            Opacity="0.99" 
                            Cursor="Hand" IsTabStop="False" Focusable="False"/>
                        <Grid Grid.Column="1">
                            <Utils:ActualSizePropertyProxy x:Name="LightBulbSwitchSizeProxy" Element="{Binding RelativeSource={RelativeSource TemplatedParent}}" Visibility="Collapsed" />
                            <Borders:ClippingBorder BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{Binding ActualHeightValue, ConverterParameter=0.5, Converter={StaticResource CornerRadiusValueConverter}, ElementName=LightBulbSwitchSizeProxy}" Margin="0" IsTabStop="False">
                                <Borders:ClippingBorder.BorderBrush>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#AA373737" Offset="0"/>
                                        <GradientStop Color="#AAF9F9F9" Offset="1"/>
                                    </LinearGradientBrush>
                                </Borders:ClippingBorder.BorderBrush>
                                <Grid x:Name="SwitchRoot" Cursor="Hand">
                                    <Borders:InnerGlowBorder x:Name="innerGlowBorder" InnerGlowColor="Black" InnerGlowOpacity="0.5" BorderThickness="0" BorderBrush="{x:Null}" Foreground="{x:Null}" InnerGlowSize="0,5,0,0" IsTabStop="False">
                                        <Borders:InnerGlowBorder.Background>
                                            <LinearGradientBrush>
                                                <GradientStop Color="#AA333333"/>
                                                <GradientStop Color="#77DDDDDD" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Borders:InnerGlowBorder.Background>
                                    </Borders:InnerGlowBorder>
                                    <Canvas x:Name="SwitchTrack" Cursor="Hand" Height="{TemplateBinding ThumbSize}" MinWidth="{TemplateBinding ThumbSize}" MinHeight="{TemplateBinding ThumbSize}">
                                        <Thumb x:Name="SwitchThumb"
                                            Width="{TemplateBinding ThumbSize}"
                                            Height="{TemplateBinding ThumbSize}"
                                            Background="{TemplateBinding ThumbBrush}"
                                            Template="{TemplateBinding ThumbTemplate}" BorderThickness="0"/>
                                    </Canvas>
                                </Grid>
                            </Borders:ClippingBorder>
                            <Border x:Name="DisabledOverlay" Background="#AAEEEEEE" Visibility="Collapsed" CornerRadius="{Binding ActualHeightValue, ConverterParameter=0.5, Converter={StaticResource CornerRadiusValueConverter}, ElementName=LightBulbSwitchSizeProxy}"/>
                        </Grid>
                        <ContentControl x:Name="SwitchCheckedLabel" 
                            Content="{TemplateBinding CheckedContent}"
                            HorizontalContentAlignment="Center" 
                            VerticalContentAlignment="Center"
                            Template="{TemplateBinding ContentTemplate}" 
                            Foreground="{TemplateBinding CheckedForeground}" 
                            Opacity="0.985" 
                            Cursor="Hand" IsTabStop="False" Grid.Column="2"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <ControlTemplate x:Key="SafariThumbControlTemplate" TargetType="Thumb">
        <Grid Background="Transparent">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.05" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.25" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement"/>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Focused">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0.05" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualElement"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Unfocused"/>
                </VisualStateGroup>
                <VisualStateGroup x:Name="CheckStates">
                    <VisualState x:Name="Unchecked"/>
                    <VisualState x:Name="Checked"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Borders:OuterGlowBorder OuterGlowSize="4" OuterGlowOpacity="0.15" BorderThickness="0" OuterGlowColor="Black" Background="Transparent" CornerRadius="2" ShadowCornerRadius="4" IsTabStop="False" >
                <Grid>
                    <Borders:ClippingBorder x:Name="Background" BorderBrush="#FF656565" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2" IsTabStop="False" Background="{TemplateBinding Background}"/>
                    <Borders:ClippingBorder x:Name="BackgroundAnimation" Background="Black" Opacity="0" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="Black" CornerRadius="2" IsTabStop="False"/>
                    <Rectangle x:Name="DisabledVisualElement" Fill="White" IsHitTestVisible="false" Opacity="0" RadiusY="2" RadiusX="2"/>
                    <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="2" RadiusX="2" StrokeThickness="1"/>
                </Grid>
            </Borders:OuterGlowBorder>
        </Grid>
    </ControlTemplate>
    <Style x:Key="SafariSwitchStyle" TargetType="ProxyToggle:HorizontalToggleSwitch">
        <Setter Property="Width" Value="120"/>
        <Setter Property="Height" Value="20"/>
        <Setter Property="BorderBrush" Value="#FF6C6C6C"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="0,4"/>
        <Setter Property="UncheckedForeground" Value="#FF3C3C3C"/>
        <Setter Property="CheckedForeground" Value="#FF3C3C3C" />
        <Setter Property="FontSize" Value="12" />
        <Setter Property="ThumbSize" Value="30" />
        <Setter Property="ContentTemplate" Value="{StaticResource EngravedContentTemplate}" />
        <Setter Property="ThumbTemplate" Value="{StaticResource HorizontalThumbTemplate}"/>
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF656565" Offset="0"/>
                    <GradientStop Color="#FFA5A5A5" Offset="1"/>
                    <GradientStop Color="#FF797979" Offset="0.095"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="ThumbBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFE1E1E1" Offset="1"/>
                    <GradientStop Color="#FFFBFBFB"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ProxyToggle:HorizontalToggleSwitch">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="DisabledOverlay">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.10" To="Unchecked"/>
                                    <VisualTransition GeneratedDuration="0:0:0.10" To="Checked"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Checked"/>
                                <VisualState x:Name="Unchecked"/>
                                <VisualState x:Name="DraggingChecked"/>
                                <VisualState x:Name="DraggingUnchecked"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Utils:ActualSizePropertyProxy x:Name="ActualSizeProxy" Element="{Binding Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" Visibility="Collapsed" IsHitTestVisible="False"/>
                        <ContentControl x:Name="OffLabel" 
                                    Content="{TemplateBinding UncheckedContent}" 
                                    HorizontalContentAlignment="Center" 
                                    VerticalContentAlignment="Center"
                                    Template="{TemplateBinding ContentTemplate}"
                                    Foreground="{TemplateBinding UncheckedForeground}" IsTabStop="False" Padding="0,0,6,0" FontWeight="{TemplateBinding FontWeight}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" Cursor="Hand" VerticalAlignment="Center" FontStyle="{TemplateBinding FontStyle}" Focusable="False" />
                        <Borders:ClippingBorder x:Name="SwitchRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2" IsTabStop="False" Grid.Column="1" Background="{TemplateBinding Background}" Cursor="Hand" >
                            <Canvas x:Name="SwitchTrack" Cursor="Hand" Height="{TemplateBinding Height}" Margin="0,-1,0,0">
                                <Thumb x:Name="SwitchThumb" 
                                            Background="{TemplateBinding ThumbBrush}" 
                                            Template="{StaticResource SafariThumbControlTemplate}" 
                                            Cursor="Hand" 
                                            Height="{Binding ActualHeightValue, ElementName=ActualSizeProxy}" 
                                            Width="{TemplateBinding ThumbSize}"
                                            HorizontalAlignment="Left" IsTabStop="False"/>
                            </Canvas>
                        </Borders:ClippingBorder>
                        <ContentControl x:Name="OnLabel" 
                                    Content="{TemplateBinding CheckedContent}"
                                    HorizontalContentAlignment="Center" 
                                    VerticalContentAlignment="Center"
                                    Template="{TemplateBinding ContentTemplate}" 
                                    Foreground="{TemplateBinding CheckedForeground}" IsTabStop="False" Grid.Column="2" Padding="6,0,0,0" FontWeight="{TemplateBinding FontWeight}"  FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" Cursor="Hand" VerticalAlignment="Center" FontStyle="{TemplateBinding FontStyle}" Focusable="False"/>
                        <Border x:Name="DisabledOverlay" Background="#AAEEEEEE" Visibility="Collapsed" CornerRadius="4" Height="27" Grid.Column="1"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="MetroToggleSwitchStyle" TargetType="ProxyToggle:HorizontalToggleSwitch">
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="Width" Value="88"/>
        <Setter Property="Height" Value="28"/>
        <Setter Property="BorderBrush" Value="#FFBEBEBE"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="0,4"/>
        <Setter Property="UncheckedForeground" Value="#FF5C5C5C"/>
        <Setter Property="CheckedForeground" Value="White"/>
        <Setter Property="ThumbSize" Value="42"/>
        <Setter Property="FontWeight" Value="SemiBold"/>
        <Setter Property="FontFamily" Value="Arial"/>
        <Setter Property="FontSize" Value="12"/>
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="ContentTemplate" Value="{StaticResource EngravedContentTemplate}"/>
        <Setter Property="ThumbTemplate" Value="{StaticResource ThumbWithDoubleArrowTemplate}"/>
        <Setter Property="CheckedBackground">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF81B5FB" Offset="1"/>
                    <GradientStop Color="#FF5D9FF2" Offset="0.50"/>
                    <GradientStop Color="#FF569BEF" Offset="0.50"/>
                    <GradientStop Color="#FF3772B9"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="UncheckedBackground">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFBBBBBB" Offset="0"/>
                    <GradientStop Color="#FFE1E2E2" Offset="0.5"/>
                    <GradientStop Color="#FFDDDDDD" Offset="0.5"/>
                    <GradientStop Color="White" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="ThumbBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFD8D7D8"/>
                    <GradientStop Color="#FFFDFCFD" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ProxyToggle:HorizontalToggleSwitch">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="DisabledOverlay">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.10" To="Unchecked"/>
                                    <VisualTransition GeneratedDuration="0:0:0.10" To="Checked"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Checked"/>
                                <VisualState x:Name="Unchecked"/>
                                <VisualState x:Name="DraggingChecked"/>
                                <VisualState x:Name="DraggingUnchecked"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Borders:ClippingBorder x:Name="SwitchRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" CornerRadius="2" IsTabStop="False">
                            <Canvas MinWidth="{TemplateBinding ThumbSize}" MinHeight="{TemplateBinding FontSize}">
                                <Utils:ActualSizePropertyProxy x:Name="ActualSizeProxy" Element="{Binding Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" Visibility="Collapsed"/>
                                <Grid x:Name="SwitchTrack" Cursor="Hand" Height="{Binding ActualHeightValue, ElementName=ActualSizeProxy, Mode=OneWay}" Margin="0,-1,0,0">
                                    <StackPanel Orientation="Horizontal">
                                        <Border Background="{TemplateBinding CheckedBackground}" Margin="-1,0,0,0" Padding="1,0,0,0">
                                            <ContentControl x:Name="SwitchChecked" Content="{TemplateBinding CheckedContent}" Foreground="{TemplateBinding CheckedForeground}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="Center" IsTabStop="False" Margin="{TemplateBinding Padding}" Padding="0,0,22,0" Template="{TemplateBinding ContentTemplate}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="Center"/>
                                        </Border>
                                        <Border Background="{TemplateBinding UncheckedBackground}" Margin="-1,0,0,0">
                                            <ContentControl x:Name="SwitchUnchecked" Content="{TemplateBinding UncheckedContent}" Foreground="{TemplateBinding UncheckedForeground}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="Center" IsTabStop="False" Margin="{TemplateBinding Padding}" Template="{TemplateBinding ContentTemplate}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="Center"/>
                                        </Border>
                                    </StackPanel>
                                </Grid>
                                <Borders:InnerGlowBorder BorderThickness="0" Background="#00000000" CornerRadius="4" Height="{Binding ActualHeightValue, ElementName=ActualSizeProxy, Mode=OneWay}" IsHitTestVisible="False" IsTabStop="False" InnerGlowOpacity="0.25" InnerGlowColor="Black" InnerGlowSize="2,4,2,0" Margin="-1,-1,0,0" Width="{Binding ActualWidthValue, ElementName=ActualSizeProxy, Mode=OneWay}"/>
                                <Thumb x:Name="SwitchThumb" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding ThumbBrush}" Cursor="Hand" Foreground="#FF359CE6" HorizontalAlignment="Left" Height="{Binding ActualHeightValue, ElementName=ActualSizeProxy, Mode=OneWay}" IsTabStop="False" Margin="0,-1,0,0" Template="{TemplateBinding ThumbTemplate}" Width="{TemplateBinding ThumbSize}"/>
                            </Canvas>
                        </Borders:ClippingBorder>
                        <Border x:Name="DisabledOverlay" Background="#AAEEEEEE" CornerRadius="4" Visibility="Collapsed"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="iPhoneToggleSwitchStyle" TargetType="{x:Type ProxyToggle:HorizontalToggleSwitch}">
        <Setter Property="Width" Value="88"/>
        <Setter Property="Height" Value="27"/>
        <Setter Property="BorderBrush" Value="#AFBEBEBE"/>
        <Setter Property="UncheckedForeground" Value="#FF5C5C5C"/>
        <Setter Property="CheckedForeground" Value="White" />
        <Setter Property="ThumbSize" Value="42"/>
        <Setter Property="FontSize" Value="12"/>
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Padding" Value="0,4" />
        <Setter Property="FontWeight" Value="SemiBold" />
        <Setter Property="FontFamily" Value="Arial" />
        <Setter Property="FontSize" Value="13" />
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="ContentTemplate" Value="{StaticResource EngravedContentTemplate}" />
        <Setter Property="ThumbTemplate" Value="{StaticResource SimpleThumbTemplate}" />
        <Setter Property="ThumbBrush" Value="{StaticResource iPhoneThumbBrush}"/>
        <Setter Property="Template" Value="{StaticResource HorizontalToggleSwitchTemplate}"/>
        <Setter Property="CheckedBackground">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF81B5FB" Offset="1"/>
                    <GradientStop Color="#FF5D9FF2" Offset="0.50"/>
                    <GradientStop Color="#FF569BEF" Offset="0.50"/>
                    <GradientStop Color="#FF3772B9"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="UncheckedBackground">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFBBBBBB" Offset="0"/>
                    <GradientStop Color="#FFE1E2E2" Offset="0.5"/>
                    <GradientStop Color="#FFDDDDDD" Offset="0.5"/>
                    <GradientStop Color="White" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="iOS5ToggleSwitchStyle" TargetType="ProxyToggle:HorizontalToggleSwitch">
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="Width" Value="65"/>
        <Setter Property="Height" Value="24"/>
        <Setter Property="BorderBrush" Value="#AFBEBEBE"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="0,4"/>
        <Setter Property="UncheckedForeground" Value="#FF5F5F5F"/>
        <Setter Property="CheckedForeground" Value="White" />
        <Setter Property="ThumbSize" Value="24"/>
        <Setter Property="FontWeight" Value="SemiBold"/>
        <Setter Property="FontFamily" Value="Arial"/>
        <Setter Property="FontSize" Value="12"/>
        <Setter Property="ContentTemplate" Value="{StaticResource EngravedContentTemplate}" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="ThumbTemplate" Value="{StaticResource iOS5ThumbTemplate}"/>
        <Setter Property="ThumbBrush" Value="{StaticResource iPhoneThumbBrush}" />
        <Setter Property="CheckedBackground">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF017FED" Offset="1"/>
                    <GradientStop Color="#FF3772B9"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="UncheckedBackground">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFBBBBBB" Offset="0"/>
                    <GradientStop Color="White" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ProxyToggle:HorizontalToggleSwitch">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="DisabledOverlay">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.10" To="Unchecked"/>
                                    <VisualTransition GeneratedDuration="0:0:0.10" To="Checked"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Checked"/>
                                <VisualState x:Name="Unchecked"/>
                                <VisualState x:Name="DraggingChecked"/>
                                <VisualState x:Name="DraggingUnchecked"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Borders:ClippingBorder x:Name="SwitchRoot" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{Binding ActualHeightValue, ConverterParameter=0.5, Converter={StaticResource CornerRadiusValueConverter}, ElementName=ActualSizeProxy}" IsTabStop="False" BorderThickness="1" >
                            <Canvas MinWidth="{TemplateBinding ThumbSize}" MinHeight="{TemplateBinding FontSize}">
                                <Utils:ActualSizePropertyProxy x:Name="ActualSizeProxy" Element="{Binding Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" Visibility="Collapsed" IsHitTestVisible="False"/>
                                <Grid x:Name="SwitchTrack" Cursor="Hand" Margin="0,-1,0,0" Height="{Binding ActualHeightValue, ElementName=ActualSizeProxy, Mode=OneWay}" >
                                    <StackPanel Orientation="Horizontal">
                                        <Border Background="{TemplateBinding CheckedBackground}" Margin="-1,0,0,0" Padding="1,0,0,0">
                                            <ContentControl x:Name="SwitchChecked" 
    											Content="{TemplateBinding CheckedContent}"
    											HorizontalContentAlignment="Center" 
    											VerticalContentAlignment="Center" 
    											Margin="{TemplateBinding Padding}"
    											Template="{TemplateBinding ContentTemplate}" 
    											Foreground="{TemplateBinding CheckedForeground}" 
    											IsTabStop="False" 
    											FontSize="{TemplateBinding FontSize}" 
    											FontFamily="{TemplateBinding FontFamily}" 
    											HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
    											VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                        </Border>
                                        <Border Background="{TemplateBinding UncheckedBackground}" Margin="-1,0,0,0">
                                            <ContentControl x:Name="SwitchUnchecked" 
    											Content="{TemplateBinding UncheckedContent}" 
    											HorizontalContentAlignment="Center" 
    											VerticalContentAlignment="Center"
    											Margin="{TemplateBinding Padding}"
    											Template="{TemplateBinding ContentTemplate}"
    											Foreground="{TemplateBinding UncheckedForeground}" 
    											IsTabStop="False" 
    											FontSize="{TemplateBinding FontSize}" 
    											FontFamily="{TemplateBinding FontFamily}" 
    											HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
    											VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                        </Border>
                                    </StackPanel>
                                </Grid>
                                <Borders:InnerGlowBorder 
    								InnerGlowSize="1,2,1,0" 
    								IsHitTestVisible="False" 
    								InnerGlowOpacity="0.25" 
    								BorderThickness="0" 
    								InnerGlowColor="Black" 
    								Background="#00000000"
    								Height="{Binding ActualHeightValue, ElementName=ActualSizeProxy, Mode=OneWay}" 
    								Width="{Binding ActualWidthValue, ElementName=ActualSizeProxy, Mode=OneWay}" 
    								Margin="-1,-1,0,0" IsTabStop="False" >
                                    <Rectangle 
    									VerticalAlignment="Bottom" 
    									RadiusX="8" 
    									RadiusY="8" 
    									StrokeThickness="0" 
    									Height="{Binding ActualHeightValue, ConverterParameter=0.5, Converter={StaticResource ScalarConverter}, ElementName=ActualSizeProxy, Mode=OneWay}" 
    									Margin="3,0">
                                        <Rectangle.Fill>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="#28FFFFFF"/>
                                                <GradientStop Color="#90FFFFFF" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Rectangle.Fill>
                                    </Rectangle>
                                </Borders:InnerGlowBorder>
                                <Thumb x:Name="SwitchThumb" 
    								Background="{TemplateBinding ThumbBrush}" 
    								Template="{TemplateBinding ThumbTemplate}" 
    								Cursor="Hand" 
    								Height="{Binding ActualHeightValue, ElementName=ActualSizeProxy, Mode=OneWay}" 
    								Width="{TemplateBinding ThumbSize}" 
    								IsTabStop="False" 
    								BorderBrush="{TemplateBinding BorderBrush}" Margin="46,-1,0,0" Focusable="False"/>
                            </Canvas>
                        </Borders:ClippingBorder>
                        <Border x:Name="DisabledOverlay" Background="#AAEEEEEE" Visibility="Collapsed" CornerRadius="{Binding ActualHeightValue, ConverterParameter=0.5, Converter={StaticResource CornerRadiusValueConverter}, ElementName=ActualSizeProxy}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <ControlTemplate x:Key="VerticalThumbTemplate" TargetType="Thumb">
        <Borders:OuterGlowBorder BorderThickness="0" OuterGlowSize="3" OuterGlowColor="Black" Background="Transparent" CornerRadius="4" ShadowCornerRadius="2" ClipContent="False" OuterGlowOpacity="0.2" IsTabStop="False" >
            <Grid Background="Transparent">
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="Normal"/>
                        <VisualState x:Name="MouseOver">
                            <Storyboard>
                                <DoubleAnimation Duration="0" To="0.05" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Pressed">
                            <Storyboard>
                                <DoubleAnimation Duration="0" To="0.25" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Disabled">
                            <Storyboard>
                                <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement"/>
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="FocusStates">
                        <VisualState x:Name="Focused">
                            <Storyboard>
                                <DoubleAnimation Duration="0" To="0.05" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualElement"/>
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Unfocused"/>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <Borders:ClippingBorder x:Name="Background" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="2" IsTabStop="False">
                    <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                        <Rectangle Fill="#7F969696" Width="14" Height="1" StrokeThickness="0"/>
                        <Rectangle Fill="#7FF8F8F8" Width="14" Height="1" StrokeThickness="0" Margin="0,0,0,2" />
                        <Rectangle Fill="#7F969696" Width="14" Height="1" StrokeThickness="0" />
                        <Rectangle Fill="#7FF8F8F8" Width="14" Height="1" StrokeThickness="0" Margin="0,0,0,2"/>
                        <Rectangle Fill="#7F969696" Width="14" Height="1" StrokeThickness="0" />
                        <Rectangle Fill="#7FF8F8F8" Width="14" Height="1" StrokeThickness="0" />
                    </StackPanel>
                </Borders:ClippingBorder>
                <Borders:ClippingBorder x:Name="BackgroundAnimation" Background="Black" Opacity="0" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="Black" CornerRadius="2" IsTabStop="False"/>
                <Rectangle x:Name="DisabledVisualElement" Fill="White" IsHitTestVisible="false" Opacity="0" RadiusY="2" RadiusX="2"/>
                <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#FF6DBDD1" StrokeThickness="1"/>
            </Grid>
        </Borders:OuterGlowBorder>
    </ControlTemplate>

    <Style TargetType="Controls:VerticalToggleSwitch">
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="Height" Value="118"/>
        <Setter Property="Width" Value="83"/>
        <Setter Property="BorderBrush" Value="#FFCACACA"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="UncheckedForeground" Value="#FF666666"/>
        <Setter Property="CheckedForeground" Value="#FF565656"/>
        <Setter Property="ThumbSize" Value="25"/>
        <Setter Property="ThumbBrush" Value="WhiteSmoke"/>
        <Setter Property="ThumbTemplate" Value="{StaticResource VerticalThumbTemplate}"/>
        <Setter Property="ContentTemplate" Value="{StaticResource EngravedContentTemplate}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Controls:VerticalToggleSwitch">
                    <Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="DisabledOverlay">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed"/>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.10" To="Unchecked"/>
                                    <VisualTransition GeneratedDuration="0:0:0.10" To="Checked"/>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="rectangle1">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="rectangle">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" To="0.75" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SwitchUncheckedLabel" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="rectangle">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="rectangle1">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" To="0.75" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SwitchCheckedLabel" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Dragging"/>
                                <VisualState x:Name="DraggingChecked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="rectangle1">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="rectangle">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" To="-81" Storyboard.TargetProperty="(Canvas.Top)" Storyboard.TargetName="SwitchThumb" />
                                        <DoubleAnimation Duration="0" To="5" Storyboard.TargetProperty="(Rectangle.RadiusX)" Storyboard.TargetName="rectangle"/>
                                        <DoubleAnimation Duration="0" To="5" Storyboard.TargetProperty="(Rectangle.RadiusY)" Storyboard.TargetName="rectangle"/>
                                        <DoubleAnimation Duration="0" To="0.75" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SwitchUncheckedLabel" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DraggingUnchecked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="rectangle">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="rectangle1">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" To="0.75" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SwitchCheckedLabel" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Borders:ClippingBorder Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" Padding="4,6,3,4" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" >
                            <Borders:ClippingBorder.Background>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FFD0D0D0" Offset="1"/>
                                    <GradientStop Color="#FFF3F3F3"/>
                                </LinearGradientBrush>
                            </Borders:ClippingBorder.Background>
                            <Grid x:Name="SwitchRoot" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" >
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Grid Grid.Column="1">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="0.5*"/>
                                        <RowDefinition Height="0.5*"/>
                                    </Grid.RowDefinitions>
                                    <Borders:ClippingBorder VerticalAlignment="Top" Margin="0,4,1,0" Cursor="Hand">
                                        <Grid Height="18">
                                            <Rectangle x:Name="rectangle" RadiusY="4" RadiusX="4" Margin="-4,0,1,0" Visibility="Collapsed">
                                                <Rectangle.Stroke>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="#88E9E9E9" Offset="1"/>
                                                        <GradientStop Color="#885E5E5E"/>
                                                    </LinearGradientBrush>
                                                </Rectangle.Stroke>
                                                <Rectangle.Fill>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="#442D2D2D"/>
                                                        <GradientStop Color="#44AFAFAF" Offset="1"/>
                                                        <GradientStop Color="#445C5C5C" Offset="0.189"/>
                                                    </LinearGradientBrush>
                                                </Rectangle.Fill>
                                            </Rectangle>
                                            <ContentControl x:Name="SwitchCheckedLabel" 
                                                Content="{TemplateBinding CheckedContent}"
                                                Background="{TemplateBinding CheckedBackground}"
                                                Template="{TemplateBinding ContentTemplate}" VerticalAlignment="Stretch" Foreground="{TemplateBinding CheckedForeground}" HorizontalAlignment="Left" Padding="2,0,4,0" IsTabStop="False" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontWeight="{TemplateBinding FontWeight}" FontStyle="{TemplateBinding FontStyle}" />
                                        </Grid>
                                    </Borders:ClippingBorder>
                                    <Borders:ClippingBorder VerticalAlignment="Bottom" Grid.Row="1" Margin="0,0,1,4" Cursor="Hand">
                                        <Grid Height="18">
                                            <Rectangle x:Name="rectangle1" RadiusY="4" RadiusX="4" Margin="-4,0,1,0" Visibility="Collapsed">
                                                <Rectangle.Stroke>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="#88C2C2C2" Offset="1"/>
                                                        <GradientStop Color="#886A6A6A"/>
                                                    </LinearGradientBrush>
                                                </Rectangle.Stroke>
                                                <Rectangle.Fill>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="#442D2D2D"/>
                                                        <GradientStop Color="#44AFAFAF" Offset="1"/>
                                                        <GradientStop Color="#445C5C5C" Offset="0.189"/>
                                                    </LinearGradientBrush>
                                                </Rectangle.Fill>
                                            </Rectangle>
                                            <ContentControl
                                                x:Name="SwitchUncheckedLabel" 
                                                Content="{TemplateBinding UncheckedContent}"
                                                Template="{TemplateBinding ContentTemplate}"
                                                VerticalAlignment="Stretch"
                                                Foreground="{TemplateBinding UncheckedForeground}" 
                                                HorizontalAlignment="Left" 
                                                Padding="2,0,4,0" 
                                                IsTabStop="False" 
                                                FontFamily="{TemplateBinding FontFamily}" 
                                                FontSize="{TemplateBinding FontSize}" 
                                                FontWeight="{TemplateBinding FontWeight}" 
                                                FontStyle="{TemplateBinding FontStyle}" />
                                        </Grid>
                                    </Borders:ClippingBorder>
                                </Grid>
                                <Borders:ClippingBorder Margin="0" CornerRadius="4">
                                    <Borders:ClippingBorder.Background>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF0ACC0D" Offset="0"/>
                                            <GradientStop Color="#FFF9FF92" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Borders:ClippingBorder.Background>
                                    <Grid>
                                        <Borders:InnerGlowBorder InnerGlowColor="Black" ClipContent="False" BorderThickness="0" CornerRadius="4" InnerGlowOpacity="0.15" Background="{x:Null}" InnerGlowSize="3,5,3,2" IsTabStop="False" />
                                        <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                                            <Path Data="M-0.79419744,59.372883 L15.553296,49.89521 L31.891663,59.372883 L31.891663,67.875198 L15.548733,58.462936 L-0.79419744,67.906197 z" Fill="#3FFFFFFF" Stretch="Fill" StrokeThickness="0" Margin="2,-3" Height="27"/>
                                            <Path Data="M-0.79419744,59.372883 L15.553296,49.89521 L31.891663,59.372883 L31.891663,67.875198 L15.548733,58.462936 L-0.79419744,67.906197 z" Fill="#3FFFFFFF" Stretch="Fill" StrokeThickness="0" Margin="2,-3" Height="27"/>
                                            <Path Data="M-0.79419744,59.372883 L15.553296,49.89521 L31.891663,59.372883 L31.891663,67.875198 L15.548733,58.462936 L-0.79419744,67.906197 z" Fill="#3FFFFFFF" Stretch="Fill" StrokeThickness="0" Margin="2,-3" Height="27"/>
                                            <Path Data="M-0.79419744,59.372883 L15.553296,49.89521 L31.891663,59.372883 L31.891663,67.875198 L15.548733,58.462936 L-0.79419744,67.906197 z" Fill="#3FFFFFFF" Stretch="Fill" StrokeThickness="0" Margin="2,-3" Height="27"/>
                                            <Path Data="M-0.79419744,59.372883 L15.553296,49.89521 L31.891663,59.372883 L31.891663,67.875198 L15.548733,58.462936 L-0.79419744,67.906197 z" Fill="#3FFFFFFF" Stretch="Fill" StrokeThickness="0" Margin="2,-3" Height="27"/>
                                            <Path Data="M-0.79419744,59.372883 L15.553296,49.89521 L31.891663,59.372883 L31.891663,67.875198 L15.548733,58.462936 L-0.79419744,67.906197 z" Fill="#3FFFFFFF" Stretch="Fill" StrokeThickness="0" Margin="2,-3" Height="27"/>
                                        </StackPanel>
                                        <Canvas x:Name="SwitchTrack" Cursor="Hand">
                                            <Utils:ActualSizePropertyProxy x:Name="ActualSizePropertyProxy" Element="{Binding ElementName=SwitchTrack, Mode=OneWay}" Visibility="Collapsed" />
                                            <Thumb x:Name="SwitchThumb"
                                                Width="{Binding ActualWidthValue, ElementName=ActualSizePropertyProxy, Mode=OneWay}"
                                                Height="{TemplateBinding ThumbSize}"
                                                Background="{TemplateBinding ThumbBrush}" 
                                                Template="{TemplateBinding ThumbTemplate}" 
                                                BorderThickness="1" 
                                                VerticalAlignment="Bottom" 
                                                IsTabStop="False" 
                                                BorderBrush="{TemplateBinding BorderBrush}"/>
                                        </Canvas>
                                    </Grid>
                                </Borders:ClippingBorder>
                            </Grid>
                        </Borders:ClippingBorder>
                        <Border x:Name="DisabledOverlay" Background="#AAEEEEEE" Visibility="Collapsed" CornerRadius="6" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
